<!doctype html>


<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>bidi.js (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>


  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>





<div class="colmask rightmenu">
<div class="colleft">
    <div class="col1">
      <!-- Column 1 start -->

<div id="title">
       <span class="fn">bidi.js</span>
</div>

<div class="g-section g-tpl-75-25">
  <div class="g-unit g-first" id="description">
    <span class='nodesc'>No description.</span>
  </div>
  

        <div class="g-unit" id="useful-links">
          <div class="title">Useful links</div>
          <ol>
            <li><a href="local_closure_goog_i18n_bidi.js.source.html"><span class='source-code-link'>Source Code</span></a></li>
            <li><a href="http://code.google.com/p/closure-library/source/browse/local/closure/goog/i18n/bidi.js">Git</a></li>
          </ol>
        </div>
</div>

<h2 class="g-first">File Location</h2>
  <div class="g-section g-tpl-20-80">
    <div class="g-unit g-first">
      <div class="g-c-cell code-label">/goog/i18n/bidi.js</div>
    </div>
  </div>
<hr/>


  <h2>Classes</h2>
 <div class="fn-constructor">
        <a href="interface_goog_i18n_bidi_DirectionalString.html">
          goog.i18n.bidi.DirectionalString</a><br/>
        <div class="class-details">Strings that have an (optional) known direction.

Implementations of this interface are string-like objects that carry an
attached direction, if known.
</div>
 </div>
      
<br/>

  <div class="legend">
        <span class="key publickey"></span><span>Public</span>
        <span class="key protectedkey"></span><span>Protected</span>
        <span class="key privatekey"></span><span>Private</span>
  </div>



<h2>Enumerations</h2>






<div class="section">
  <table class="horiz-rule">


  </table>
</div>




  <h2>Global Functions</h2>





<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.bidi.detectRtlDirectionality"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.i18n.bidi.</span><span class="entryName">detectRtlDirectionality<span class="args">(<span class="arg">str</span>,&nbsp;<span class="arg">opt_isHtml</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Check the directionality of a piece of text, return true if the piece of
text should be laid out in RTL direction.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">str</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">The piece of text that need to be detected.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_isHtml</span>
        : <span class="type">boolean=</span>
        <div class="entryOverview">Whether str is HTML / HTML-escaped.
    Default: false.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether this piece of text should be laid out in RTL.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_i18n_bidi.js.source.html#line825">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.bidi.endsWithLtr"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.i18n.bidi.</span><span class="entryName">endsWithLtr<span class="args">(<span class="arg">str</span>,&nbsp;<span class="arg">opt_isHtml</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Check if the exit directionality a piece of text is LTR, i.e. if the last
strongly-directional character in the string is LTR.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">str</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">String being checked.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_isHtml</span>
        : <span class="type">boolean=</span>
        <div class="entryOverview">Whether str is HTML / HTML-escaped.
    Default: false.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether LTR exit directionality was detected.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_i18n_bidi.js.source.html#line469">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.bidi.endsWithRtl"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.i18n.bidi.</span><span class="entryName">endsWithRtl<span class="args">(<span class="arg">str</span>,&nbsp;<span class="arg">opt_isHtml</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Check if the exit directionality a piece of text is RTL, i.e. if the last
strongly-directional character in the string is RTL.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">str</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">String being checked.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_isHtml</span>
        : <span class="type">boolean=</span>
        <div class="entryOverview">Whether str is HTML / HTML-escaped.
    Default: false.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether RTL exit directionality was detected.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_i18n_bidi.js.source.html#line495">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.bidi.enforceLtrInHtml"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.i18n.bidi.</span><span class="entryName">enforceLtrInHtml<span class="args">(<span class="arg">html</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
      </div>


     <div class="entryOverview">
       Enforce the html snippet in RTL directionality regardless overall context.
If the html piece was enclosed by tag, dir will be applied to existing
tag, otherwise a span tag will be added as wrapper. For this reason, if
html snippet start with with tag, this tag must enclose the whole piece. If
the tag already has a dir specified, this new one will override existing
one in behavior (tested on FF and IE).

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">html</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">The string that need to be processed.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&nbsp;
            The processed string, with directionality enforced to RTL.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_i18n_bidi.js.source.html#line649">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.bidi.enforceLtrInText"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.i18n.bidi.</span><span class="entryName">enforceLtrInText<span class="args">(<span class="arg">text</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
      </div>


     <div class="entryOverview">
       Enforce LTR on both end of the given text piece using unicode BiDi formatting
characters LRE and PDF.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">text</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">The piece of text that need to be wrapped.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&nbsp;
            The wrapped string after process.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_i18n_bidi.js.source.html#line664">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.bidi.enforceRtlInHtml"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.i18n.bidi.</span><span class="entryName">enforceRtlInHtml<span class="args">(<span class="arg">html</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
      </div>


     <div class="entryOverview">
       Enforce the html snippet in RTL directionality regardless overall context.
If the html piece was enclosed by tag, dir will be applied to existing
tag, otherwise a span tag will be added as wrapper. For this reason, if
html snippet start with with tag, this tag must enclose the whole piece. If
the tag already has a dir specified, this new one will override existing
one in behavior (tested on FF and IE).

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">html</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">The string that need to be processed.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&nbsp;
            The processed string, with directionality enforced to RTL.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_i18n_bidi.js.source.html#line619">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.bidi.enforceRtlInText"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.i18n.bidi.</span><span class="entryName">enforceRtlInText<span class="args">(<span class="arg">text</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
      </div>


     <div class="entryOverview">
       Enforce RTL on both end of the given text piece using unicode BiDi formatting
characters RLE and PDF.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">text</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">The piece of text that need to be wrapped.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&nbsp;
            The wrapped string after process.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_i18n_bidi.js.source.html#line634">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.bidi.estimateDirection"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.i18n.bidi.</span><span class="entryName">estimateDirection<span class="args">(<span class="arg">str</span>,&nbsp;<span class="arg">opt_isHtml</span>)</span>
        </span>
        &#8658; <span class="type">goog.i18n.bidi.Dir</span>
      </div>


     <div class="entryOverview">
       Estimates the directionality of a string based on relative word counts.
If the number of RTL words is above a certain percentage of the total number
of strongly directional words, returns RTL.
Otherwise, if any words are strongly or weakly LTR, returns LTR.
Otherwise, returns UNKNOWN, which is used to mean "neutral".
Numbers are counted as weakly LTR.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">str</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">The string to be checked.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_isHtml</span>
        : <span class="type">boolean=</span>
        <div class="entryOverview">Whether str is HTML / HTML-escaped.
    Default: false.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type">goog.i18n.bidi.Dir</span>&nbsp;
            Estimated overall directionality of <code> str</code>.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_i18n_bidi.js.source.html#line790">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.bidi.guardBracketInHtml"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.i18n.bidi.</span><span class="entryName">guardBracketInHtml<span class="args">(<span class="arg">s</span>,&nbsp;<span class="arg">opt_isRtlContext</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
      </div>


     <div class="entryOverview">
       Apply bracket guard using html span tag. This is to address the problem of
messy bracket display frequently happens in RTL layout.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">s</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">The string that need to be processed.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_isRtlContext</span>
        : <span class="type">boolean=</span>
        <div class="entryOverview">specifies default direction (usually
    direction of the UI).</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&nbsp;
            The processed string, with all bracket guarded.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_i18n_bidi.js.source.html#line579">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.bidi.guardBracketInText"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.i18n.bidi.</span><span class="entryName">guardBracketInText<span class="args">(<span class="arg">s</span>,&nbsp;<span class="arg">opt_isRtlContext</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
      </div>


     <div class="entryOverview">
       Apply bracket guard using LRM and RLM. This is to address the problem of
messy bracket display frequently happens in RTL layout.
This version works for both plain text and html. But it does not work as
good as guardBracketInHtml in some cases.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">s</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">The string that need to be processed.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_isRtlContext</span>
        : <span class="type">boolean=</span>
        <div class="entryOverview">specifies default direction (usually
    direction of the UI).</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&nbsp;
            The processed string, with all bracket guarded.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_i18n_bidi.js.source.html#line601">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.bidi.hasAnyLtr"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.i18n.bidi.</span><span class="entryName">hasAnyLtr<span class="args">(<span class="arg">str</span>,&nbsp;<span class="arg">opt_isHtml</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Test whether the given string has any LTR characters in it.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">str</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">The given string that need to be tested.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_isHtml</span>
        : <span class="type">boolean=</span>
        <div class="entryOverview">Whether str is HTML / HTML-escaped.
    Default: false.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether the string contains LTR characters.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_i18n_bidi.js.source.html#line289">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.bidi.hasAnyRtl"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.i18n.bidi.</span><span class="entryName">hasAnyRtl<span class="args">(<span class="arg">str</span>,&nbsp;<span class="arg">opt_isHtml</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Test whether the given string has any RTL characters in it.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">str</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">The given string that need to be tested.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_isHtml</span>
        : <span class="type">boolean=</span>
        <div class="entryOverview">Whether str is HTML / HTML-escaped.
    Default: false.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether the string contains RTL characters.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_i18n_bidi.js.source.html#line267">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td class="deprecated">
    <a name="goog.i18n.bidi.hasRtlChar"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.i18n.bidi.</span><span class="entryName">hasRtlChar<span class="args">(<span class="arg">str</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       <span class="deprecatedMessage">Use hasAnyRtl.</span>
       Test whether the given string has any RTL characters in it.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">str</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">The given string that need to be tested.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether the string contains RTL characters.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_i18n_bidi.js.source.html#line279">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.bidi.isLtrChar"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.i18n.bidi.</span><span class="entryName">isLtrChar<span class="args">(<span class="arg">str</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Check if the first character in the string is LTR or not.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">str</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">The given string that need to be tested.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether the first character in str is an LTR char.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_i18n_bidi.js.source.html#line328">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td class="deprecated">
    <a name="goog.i18n.bidi.isLtrExitText"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.i18n.bidi.</span><span class="entryName">isLtrExitText<span class="args">(<span class="arg">str</span>,&nbsp;<span class="arg">opt_isHtml</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       <span class="deprecatedMessage">Use endsWithLtr.</span>
       Check if the exit directionality a piece of text is LTR, i.e. if the last
strongly-directional character in the string is LTR.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">str</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">String being checked.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_isHtml</span>
        : <span class="type">boolean=</span>
        <div class="entryOverview">Whether str is HTML / HTML-escaped.
    Default: false.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether LTR exit directionality was detected.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_i18n_bidi.js.source.html#line484">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td class="deprecated">
    <a name="goog.i18n.bidi.isLtrText"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.i18n.bidi.</span><span class="entryName">isLtrText<span class="args">(<span class="arg">str</span>,&nbsp;<span class="arg">opt_isHtml</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       <span class="deprecatedMessage">Use startsWithLtr.</span>
       Check whether the first strongly directional character (if any) is LTR.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">str</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">String being checked.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_isHtml</span>
        : <span class="type">boolean=</span>
        <div class="entryOverview">Whether str is HTML / HTML-escaped.
    Default: false.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether LTR directionality is detected using the first
    strongly-directional character method.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_i18n_bidi.js.source.html#line412">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.bidi.isNeutralChar"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.i18n.bidi.</span><span class="entryName">isNeutralChar<span class="args">(<span class="arg">str</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Check if the first character in the string is neutral or not.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">str</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">The given string that need to be tested.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether the first character in str is a neutral char.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_i18n_bidi.js.source.html#line338">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.bidi.isNeutralText"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.i18n.bidi.</span><span class="entryName">isNeutralText<span class="args">(<span class="arg">str</span>,&nbsp;<span class="arg">opt_isHtml</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Check whether the input string either contains no strongly directional
characters or looks like a url.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">str</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">String being checked.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_isHtml</span>
        : <span class="type">boolean=</span>
        <div class="entryOverview">Whether str is HTML / HTML-escaped.
    Default: false.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether neutral directionality is detected.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_i18n_bidi.js.source.html#line434">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.bidi.isRtlChar"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.i18n.bidi.</span><span class="entryName">isRtlChar<span class="args">(<span class="arg">str</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Check if the first character in the string is RTL or not.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">str</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">The given string that need to be tested.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether the first character in str is an RTL char.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_i18n_bidi.js.source.html#line318">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td class="deprecated">
    <a name="goog.i18n.bidi.isRtlExitText"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.i18n.bidi.</span><span class="entryName">isRtlExitText<span class="args">(<span class="arg">str</span>,&nbsp;<span class="arg">opt_isHtml</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       <span class="deprecatedMessage">Use endsWithRtl.</span>
       Check if the exit directionality a piece of text is RTL, i.e. if the last
strongly-directional character in the string is RTL.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">str</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">String being checked.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_isHtml</span>
        : <span class="type">boolean=</span>
        <div class="entryOverview">Whether str is HTML / HTML-escaped.
    Default: false.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether RTL exit directionality was detected.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_i18n_bidi.js.source.html#line510">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.bidi.isRtlLanguage"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.i18n.bidi.</span><span class="entryName">isRtlLanguage<span class="args">(<span class="arg">lang</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Check if a BCP 47 / III language code indicates an RTL language, i.e. either:
- a language code explicitly specifying one of the right-to-left scripts,
  e.g. "az-Arab", or<p>
- a language code specifying one of the languages normally written in a
  right-to-left script, e.g. "fa" (Farsi), except ones explicitly specifying
  Latin or Cyrillic script (which are the usual LTR alternatives).<p>
The list of right-to-left scripts appears in the 100-199 range in
<a href="http://www.unicode.org/iso15924/iso15924-num.html">http://www.unicode.org/iso15924/iso15924-num.html</a>, of which Arabic and
Hebrew are by far the most widely used. We also recognize Thaana, N'Ko, and
Tifinagh, which also have significant modern usage. The rest (Syriac,
Samaritan, Mandaic, etc.) seem to have extremely limited or no modern usage
and are not recognized to save on code size.
The languages usually written in a right-to-left script are taken as those
with Suppress-Script: Hebr|Arab|Thaa|Nkoo|Tfng  in
<a href="http://www.iana.org/assignments/language-subtag-registry">http://www.iana.org/assignments/language-subtag-registry</a>,
as well as Central (or Sorani) Kurdish (ckb), Sindhi (sd) and Uyghur (ug).
Other subtags of the language code, e.g. regions like EG (Egypt), are
ignored.
</p></p>
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">lang</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">BCP 47 (a.k.a III) language code.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether the language code is an RTL language.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_i18n_bidi.js.source.html#line548">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td class="deprecated">
    <a name="goog.i18n.bidi.isRtlText"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.i18n.bidi.</span><span class="entryName">isRtlText<span class="args">(<span class="arg">str</span>,&nbsp;<span class="arg">opt_isHtml</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       <span class="deprecatedMessage">Use startsWithRtl.</span>
       Check whether the first strongly directional character (if any) is RTL.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">str</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">String being checked.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_isHtml</span>
        : <span class="type">boolean=</span>
        <div class="entryOverview">Whether str is HTML / HTML-escaped.
    Default: false.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether RTL directionality is detected using the first
    strongly-directional character method.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_i18n_bidi.js.source.html#line386">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.bidi.mirrorCSS"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.i18n.bidi.</span><span class="entryName">mirrorCSS<span class="args">(<span class="arg">cssStr</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
      </div>


     <div class="entryOverview">
       Swap location parameters and 'left'/'right' in CSS specification. The
processed string will be suited for RTL layout. Though this function can
cover most cases, there are always exceptions. It is suggested to put
those exceptions in separate group of CSS string.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">cssStr</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">CSS spefication string.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&nbsp;
            Processed CSS specification string.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_i18n_bidi.js.source.html#line710">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.bidi.normalizeHebrewQuote"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.i18n.bidi.</span><span class="entryName">normalizeHebrewQuote<span class="args">(<span class="arg">str</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
      </div>


     <div class="entryOverview">
       Replace the double and single quote directly after a Hebrew character with
GERESH and GERSHAYIM. In such case, most likely that's user intention.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">str</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">String that need to be processed.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&nbsp;
            Processed string with double/single quote replaced.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_i18n_bidi.js.source.html#line744">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.bidi.setElementDirAndAlign"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.i18n.bidi.</span><span class="entryName">setElementDirAndAlign<span class="args">(<span class="arg">element</span>,&nbsp;<span class="arg">dir</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Sets text input element's directionality and text alignment based on a
given directionality. Does nothing if the given directionality is unknown or
neutral.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">element</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/DOM/Element">Element</a></span>
        <div class="entryOverview">Input field element to set directionality to.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">dir</span>
        : <span class="type">goog.i18n.bidi.Dir</span><span>&nbsp;|&nbsp;</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span><span>&nbsp;|&nbsp;</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span><span>&nbsp;|&nbsp;</span><span class="type">null</span>
        <div class="entryOverview">Desired directionality,
    given in one of the following formats:
    1. A goog.i18n.bidi.Dir constant.
    2. A number (positive = LRT, negative = RTL, 0 = neutral).
    3. A boolean (true = RTL, false = LTR).
    4. A null for unknown directionality.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_i18n_bidi.js.source.html#line843">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.bidi.startsWithLtr"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.i18n.bidi.</span><span class="entryName">startsWithLtr<span class="args">(<span class="arg">str</span>,&nbsp;<span class="arg">opt_isHtml</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Check whether the first strongly directional character (if any) is LTR.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">str</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">String being checked.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_isHtml</span>
        : <span class="type">boolean=</span>
        <div class="entryOverview">Whether str is HTML / HTML-escaped.
    Default: false.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether LTR directionality is detected using the first
    strongly-directional character method.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_i18n_bidi.js.source.html#line397">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.bidi.startsWithRtl"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.i18n.bidi.</span><span class="entryName">startsWithRtl<span class="args">(<span class="arg">str</span>,&nbsp;<span class="arg">opt_isHtml</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Check whether the first strongly directional character (if any) is RTL.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">str</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">String being checked.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_isHtml</span>
        : <span class="type">boolean=</span>
        <div class="entryOverview">Whether str is HTML / HTML-escaped.
    Default: false.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether RTL directionality is detected using the first
    strongly-directional character method.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_i18n_bidi.js.source.html#line371">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.bidi.stripHtmlIfNeeded_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.i18n.bidi.</span><span class="entryName">stripHtmlIfNeeded_<span class="args">(<span class="arg">str</span>,&nbsp;<span class="arg">opt_isStripNeeded</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
      </div>


     <div class="entryOverview">
       Returns the input text with spaces instead of HTML tags or HTML escapes, if
opt_isStripNeeded is true. Else returns the input as is.
Useful for text directionality estimation.
Note: the function should not be used in other contexts; it is not 100%
correct, but rather a good-enough implementation for directionality
estimation purposes.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">str</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">The given string.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_isStripNeeded</span>
        : <span class="type">boolean=</span>
        <div class="entryOverview">Whether to perform the stripping.
    Default: false (to retain consistency with calling functions).</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&nbsp;
            The given string cleaned of HTML tags / escapes.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_i18n_bidi.js.source.html#line238">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.bidi.toDir"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.i18n.bidi.</span><span class="entryName">toDir<span class="args">(<span class="arg">givenDir</span>,&nbsp;<span class="arg">opt_noNeutral</span>)</span>
        </span>
        &#8658; <span>?</span><span class="type">goog.i18n.bidi.Dir</span>
      </div>


     <div class="entryOverview">
       Convert a directionality given in various formats to a goog.i18n.bidi.Dir
constant. Useful for interaction with different standards of directionality
representation.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">givenDir</span>
        : <span class="type">goog.i18n.bidi.Dir</span><span>&nbsp;|&nbsp;</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span><span>&nbsp;|&nbsp;</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span><span>&nbsp;|&nbsp;</span><span class="type">null</span>
        <div class="entryOverview">Directionality given
    in one of the following formats:
    1. A goog.i18n.bidi.Dir constant.
    2. A number (positive = LTR, negative = RTL, 0 = neutral).
    3. A boolean (true = RTL, false = LTR).
    4. A null for unknown directionality.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_noNeutral</span>
        : <span class="type">boolean=</span>
        <div class="entryOverview">Whether a givenDir of zero or
    goog.i18n.bidi.Dir.NEUTRAL should be treated as null, i.e. unknown, in
    order to preserve legacy behavior.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>?</span><span class="type">goog.i18n.bidi.Dir</span>&nbsp;
            A goog.i18n.bidi.Dir constant matching the
    given directionality. If given null, returns null (i.e. unknown).
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_i18n_bidi.js.source.html#line178">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>






      <!-- Column 1 end -->
    </div>

        <div class="col2">
          <!-- Column 2 start -->
          <div class="col2-c">
            <h2 id="ref-head">Directory i18n</h2>
            <div id="localView"></div>
          </div>

          <div class="col2-c">
            <h2 id="ref-head">File Reference</h2>
            <div id="sideFileIndex" rootPath="" current="/goog/i18n/bidi.js"></div>
          </div>
          <!-- Column 2 end -->
        </div>
</div>
</div>

</body>
</html>
